import http from "@/utils/http";
import { AxiosRequestConfig } from "axios";

export interface GetMetricsQuestion_ {
  /**
   * @description 派生指标id
   * @format int32
   * @example 1
   */
  id: number;
}
export interface DeleteMetricsQuestion_ {
  /**
   * @description 主键id
   * @format int32
   * @example 1
   */
  id: number;
}
export interface PutMetricsQuestionCancelTop_ {
  /**
   * @description 主键id
   * @format int32
   * @example 1
   */
  id: number;
}
export interface PutMetricsQuestionTop_ {
  /**
   * @description 主键id
   * @example 1
   */
  id: string;
}

export class MetricsQuestion {
  /**
   * 查询问题
   *
   * @tags 指标提问
   * @request GET: /metrics-question
   * @secure
   */
  getMetricsQuestion = (query: { id: number } | GetMetricsQuestion_, params: AxiosRequestConfig = {}) =>
    http.request<defs.ResponseEntityListMetricsQuestionVO>({
      url: `/metrics-question`,
      method: "GET",
      params: query,
      ...params,
    });

  /**
   * 创建问题
   *
   * @tags 指标提问
   * @request POST: /metrics-question
   * @secure
   */
  postMetricsQuestion = (dto: defs.MetricsQuestionDTO, params: AxiosRequestConfig = {}) =>
    http.request<defs.ResponseEntityBoolean>({
      url: `/metrics-question`,
      method: "POST",
      data: dto,
      ...params,
    });

  /**
   * 删除信息
   *
   * @tags 指标提问
   * @request DELETE: /metrics-question
   * @secure
   */
  deleteMetricsQuestion = (query: { id: number } | DeleteMetricsQuestion_, params: AxiosRequestConfig = {}) =>
    http.request<defs.ResponseEntityBoolean>({
      url: `/metrics-question`,
      method: "DELETE",
      params: query,
      ...params,
    });

  /**
   * 恢复
   *
   * @tags 指标提问
   * @request PUT: /metrics-question/cancel-top
   * @secure
   */
  putMetricsQuestionCancelTop = (
    query: { id: number } | PutMetricsQuestionCancelTop_,
    params: AxiosRequestConfig = {},
  ) =>
    http.request<defs.ResponseEntityBoolean>({
      url: `/metrics-question/cancel-top`,
      method: "PUT",
      params: query,
      ...params,
    });

  /**
   * 置顶
   *
   * @tags 指标提问
   * @request PUT: /metrics-question/top
   * @secure
   */
  putMetricsQuestionTop = (query: { id: string } | PutMetricsQuestionTop_, params: AxiosRequestConfig = {}) =>
    http.request<defs.ResponseEntityBoolean>({
      url: `/metrics-question/top`,
      method: "PUT",
      params: query,
      ...params,
    });
}

export default new MetricsQuestion();
